﻿using System;
using fastCSharp;

namespace diantou.web.onlineJudge
{
    /// <summary>
    /// 问题运行效率排行榜
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsReferer = false)]
    partial class solutionRank : rank<solutionRank>
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="problemId"></param>
        /// <param name="language"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        private bool loadView(int problemId, diantou.dataModel.judgeState.languageType language, int page)
        {
            if (base.loadView(problemId))
            {
                load(diantou.dataAccess.tcpCall.judge.getRank(problemId, language, pageInfo.Size = 20, pageInfo.Page = page, out pageInfo.Count));
                if (requestHeader.IsSearchEngine) pageInfo.Path = problem.Path.AcceptedUser.ToPageString();
                return true;
            }
            return false;
        }
        /// <summary>
        /// 获取当前用户排行提交
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        protected override diantou.dataAccess.judge getRank(out int index)
        {
            return diantou.dataAccess.tcpCall.judge.getRank(currentUser.Id, query.problemId, query.language, out index);
        }

    }
}
